Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next

Export data from a view to excel file / csv file using java agent

Hi Sunny,

From the Java Agent get a PrintWriter object and write the data as an HTML Table with the rows being the entries you want to export.

PrintWriter pw = getAgentOutput();
pw.println("Content-type: application/vnd.ms-excel; charset=utf-8");
pw.println("Content-disposition: attachment; filename=my_excel_file.xls");
pw.println("<!DOCTYPE html>\r" +
"<html>\r" +
"<head>\r" +
"<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\r" +
"<title>My Excel File</title>\r" +
"</head>\r" +
"<body>\r" +
"<table>\r" +

########################################################################
# write your table header followed by your table rows here
# <tr><th>Column Header 1</th><th>Column Header 2<\th>......</tr>\r" +
# <tr><td>Data 1</td><td>Data 2</td>.....</tr>\r" +
########################################################################

"</table>\r" +
"</body>\r" +
"</html>\r");


Gary Forghetti




Feedback response number WEBB99NMJY created by ~Judy Elhipipulings on 07/16/2013

Export data from a view to excel fi... (~Lorraine Umfoo... 12.Jul.13)
. . Export CSV (~Dan Kikiterobu... 12.Jul.13)
. . Export data from a view to excel fi... (~Judy Elhipipul... 16.Jul.13)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS